<!--{eval $_TPL['nosidebar']=1;}-->
<!--{template header}-->

<!-- container begin -->
	<div class="container">
		<div class="page_login">
			<h1>请登录</h1>
			<form id="loginform" name="loginform" action="do.php?ac=$_SCONFIG[login_action]&$url_plus&ref" method="post">
			<table class="page_login_form">
				<!--{if $_SCONFIG['seccode_login']}-->
					<!--{if $_SGLOBAL['input_seccode']}-->
						<tr>
							<th width="100">&nbsp;</th>
							<td>
							请通过下面的验证后，再提交登录
							</td>
						</tr>
					<!--{/if}-->
					<!--{if $_SCONFIG['questionmode']}-->
						<tr>
							<th width="100" style="vertical-align: top;">请先回答问题</th>
							<td>
								<p><!--{eval question();}--></p>
								<input type="text" id="seccode" name="seccode" value="" tabindex="1" class="t_input"<!--{if empty($_SGLOBAL['input_seccode'])}--> onBlur="checkSeccode()"<!--{/if}--> />&nbsp;<span id="checkseccode">&nbsp;</span>
							</td>
						</tr>
					<!--{else}-->
						<tr>
							<th width="100" style="vertical-align: top;">验证码</th>
							<td>
								<script>seccode();</script>
								<p>请输入上面的4位字母或数字，看不清可<a href="javascript:updateseccode()">更换一张</a></p>
								<input type="text" id="seccode" name="seccode" value="" tabindex="1" class="t_input"<!--{if empty($_SGLOBAL['input_seccode'])}--> onBlur="checkSeccode()"<!--{/if}--> />&nbsp;<span id="checkseccode">&nbsp;</span>
							</td>
						</tr>
					<!--{/if}-->
				<!--{/if}-->
				<tr>
					<td>帐号：</td>
					<td><input type="text" name="username" id="username" class="page_login_text" value="$membername"/>
				</tr>
				<tr>
					<td>密码：</td>
					<td><input type="password" name="password" id="password" value="$password"class="page_login_text" /> <a href="do.php?ac=lostpasswd" title="忘记密码" class="forget_pw">忘记密码？</a></td>
				</tr>
				<tr>
					<td></td>
					<td>
						<input type="hidden" name="refer" value="$refer" />
						<input type="submit" id="loginsubmit" name="loginsubmit" class="page_login_sub" value=" 登 录 " />
					</td>
				</tr>
				<tr>
					<td></td>
					<td>还没注册？ <a href="do.php?ac=$_SCONFIG[register_action]" >立即注册</a></td>
				</tr>
			</table>
		</div>
	</div>
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
</form>


<script type="text/javascript">
	var lastSecCode = '';
	function checkSeccode() {
		var seccodeVerify = $('seccode').value;
		if(seccodeVerify == lastSecCode) {
			return;
		} else {
			lastSecCode = seccodeVerify;
		}
		ajaxresponse('checkseccode', 'op=checkseccode&seccode=' + (is_ie && document.charset == 'utf-8' ? encodeURIComponent(seccodeVerify) : seccodeVerify));
	}
	function ajaxresponse(objname, data) {
		var x = new Ajax('XML', objname);
		x.get('do.php?ac=$_SCONFIG[register_action]&' + data, function(s){
			var obj = $(objname);
			s = trim(s);
			if(s.indexOf('succeed') > -1) {
				obj.style.display = '';
				obj.innerHTML = '<img src="image/check_right.gif" width="13" height="13">';
				obj.className = "warning";
			} else {
				warning(obj, s);
			}
		});
	}
	function warning(obj, msg) {
		if((ton = obj.id.substr(5, obj.id.length)) != 'password2') {
			$(ton).select();
		}
		obj.style.display = '';
		obj.innerHTML = '<img src="image/check_error.gif" width="13" height="13"> &nbsp; ' + msg;
		obj.className = "warning";
	}
</script>

<!--{if $_SGLOBAL['input_seccode']}-->
<script>
$('seccode').style.background = '#FFFFCC';
$('seccode').focus();
</script>
<!--{/if}-->

<!--{template footer}-->

